Conversation
Use the user's chosen layout as XKB group 1 everywhere (live apply, locale1, KWin, and install-time files) so non-ASCII layouts default correctly with US as the fallback. Refresh additional layout info and group-switch options in createJobs(), and write etc/skel/.config/kxkbrc during install when configure.kwin is enabled. Signed-off-by: Peter Jung <admin@ptr1337.dev>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts keyboard layout handling so the user-selected layout is consistently treated as XKB group 1 (with an additional fallback layout as group 2) across live application, locale1, KWin, and install-time written config. It also adds install-time seeding of KDE’s kxkbrc into /etc/skel when KWin configuration is enabled.
Changes:
- Reorders layout/variant lists so the selected layout/variant is written first everywhere (X11,
/etc/default/keyboard, locale1, KWin). - Refreshes
AdditionalLayoutInfoand group-switch options inConfig::createJobs(). - Adds optional writing of KDE Plasma keyboard config to
etc/skel/.config/kxkbrcduring install, plus updates unit tests for the new variant ordering.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/modules/keyboard/Tests.cpp |
Updates expected variant list ordering in tests. |
src/modules/keyboard/SetKeyboardLayoutJob.h |
Extends job API with a flag to write KDE keyboard config. |
src/modules/keyboard/SetKeyboardLayoutJob.cpp |
Reorders written layouts/variants and adds /etc/skel/.config/kxkbrc generation. |
src/modules/keyboard/Config.cpp |
Reorders layout/variant application for XKB/locale1/KWin and refreshes additional layout info before creating jobs. |
Comments suppressed due to low confidence (2)
src/modules/keyboard/SetKeyboardLayoutJob.cpp:483
- The KDE skel seeding is skipped entirely if the target doesn't already have etc/skel (skelDir.exists()). Since writeKdeKeyboardData() already creates the parent directory for kxkbrc, consider creating etc/skel as needed (mkpath) or at least logging a warning; otherwise enabling writeKdeKeyboardConfig may silently do nothing on systems without a pre-existing /etc/skel.
if ( m_writeKdeKeyboardConfig && !( m_skipIfNoRoot && ( destDir.isEmpty() || destDir.isRoot() ) ) )
{
QDir skelDir( destDir.absoluteFilePath( "etc/skel" ) );
if ( skelDir.exists() )
{
QString kdeKeyboardPath = skelDir.absoluteFilePath( ".config/kxkbrc" );
if ( !writeKdeKeyboardData( kdeKeyboardPath, m_model, m_layout, m_variant, m_additionalLayoutInfo ) )
{
return Calamares::JobResult::error(
tr( "Failed to write keyboard configuration for KDE Plasma.", "@error" ),
tr( "Failed to write to %1", "@error, %1 is KDE keyboard configuration path" ).arg( kdeKeyboardPath ) );
}
}
}
src/modules/keyboard/SetKeyboardLayoutJob.cpp:472
- The skip condition uses QDir::isEmpty() ("destDir.isEmpty()"), but QDir::isEmpty() checks whether the directory contains entries, not whether the QDir was constructed from an empty path / missing rootMountPoint. If the intent is to detect an unset rootMountPoint, use the rootMountPoint string’s isEmpty() (or destDir.path().isEmpty()) instead; otherwise this condition can behave unexpectedly depending on the current working directory’s contents.
if ( m_writeKdeKeyboardConfig && !( m_skipIfNoRoot && ( destDir.isEmpty() || destDir.isRoot() ) ) )
{
QDir skelDir( destDir.absoluteFilePath( "etc/skel" ) );
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| config.setValue( QStringLiteral( "ResetOldOptions" ), true ); | ||
| config.setValue( QStringLiteral( "Options" ), additionalLayoutInfo.groupSwitcher ); | ||
| } |
vnepogodin
requested changes
Jul 28, 2026
vnepogodin
left a comment
Member
There was a problem hiding this comment.
rebase on cachyos branch missing vconsole.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the user's chosen layout as XKB group 1 everywhere (live apply, locale1, KWin, and install-time files) so non-ASCII layouts default correctly with US as the fallback. Refresh additional layout info and group-switch options in createJobs(), and write etc/skel/.config/kxkbrc during install when configure.kwin is enabled.